import DeviceInfo from 'react-native-device-info';
import { useEffect, useCallback, useRef } from 'react';

/*
*  修改OneForAllStore里的各个 standby的值，来触发接口查询函数
*/
import OneForAllStore from './OneForAllStore';

interface ExecutorKeys {
    queryAssets : string,
    standbyAssets: string,
}

export const executorKeys:ExecutorKeys = {
    queryAssets: "queryAssets",
    standbyAssets: "standbyAssets"
}

const RunExecutor: (exec: keyof ExecutorKeys) => void = (exec: keyof ExecutorKeys) => {

    switch(exec) {
        case executorKeys.queryAssets:
            console.log("OneForAll::执行器:: 执行器筛选结束 =》 触发UserName更改器,",OneForAllStore.AssetsStandBy)
            OneForAllStore.setAssetsStandBy(false);
            break;
        case executorKeys.standbyAssets:
            OneForAllStore.setAssetsStandBy(true);
            break;
        default:
            break;
    }

}

export default RunExecutor;